<html>
<head><meta charset="utf-8"><title>Inverted syntax · project-inline-asm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/index.html">project-inline-asm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Inverted.20syntax.html">Inverted syntax</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219160440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Inverted%20syntax/near/219160440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> whatisaphone <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Inverted.20syntax.html#219160440">(Dec 08 2020 at 01:13)</a>:</h4>
<p>I know I'm late to the party here, and sorry for the bikeshed, but have you thought about a syntax that puts the inputs/outputs before the code, instead of after? The old syntax always seemed backwards to me (ever since I first saw it in gcc). Most other places in Rust, you need to declare a binding before you use it.</p>
<p>To maybe explain myself visually, imagine if normal functions were defined that way:</p>
<div class="codehilite"><pre><span></span><code>fn add_numbers {
    x + y
} (x: i32, y: i32) -&gt; i32
</code></pre></div>



<a name="219160994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Inverted%20syntax/near/219160994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Inverted.20syntax.html#219160994">(Dec 08 2020 at 01:23)</a>:</h4>
<p>While I agree with you, the current syntax is consistent with format args, which have the format literal first (including named captures like <code>{name}</code> that are referred to with <code>name = val</code> later)</p>



<a name="219193302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Inverted%20syntax/near/219193302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Inverted.20syntax.html#219193302">(Dec 08 2020 at 10:53)</a>:</h4>
<p>You could consider the inline asm code as kind of a function name. When you do, putting the inputs after the inline asm code makes sense in my opinion.</p>



<a name="219233810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Inverted%20syntax/near/219233810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> whatisaphone <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Inverted.20syntax.html#219233810">(Dec 08 2020 at 17:12)</a>:</h4>
<p>Ah yeah that makes sense. If you think about it as a string instead of code, it fits right in. And I guess asm kind of _is_ just a string in some ways</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>